#include "widget.h"
#include "ui_widget.h"
#include <QButtonGroup>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    //radiobutton按钮实例
//    ui->radioButton->setChecked(true);
//    ui->label->setText("你转世成为：小猴子");
//    //修改按钮不能被选中，但是还是点击按钮还是可以触发槽函数的事件
//    ui->radioButton_2->setCheckable(false);
//    //修改按键的状态不能被选中
//    ui->radioButton->setEnabled(false);
    //通过radiobutton按钮来创建一个修炼系统
    //通过QButtonGrounp控件对radiobutton进行分组
    QButtonGroup *grounp1 = new QButtonGroup(this);
    QButtonGroup *grounp2 = new QButtonGroup(this);
    QButtonGroup *grounp3 = new QButtonGroup(this);

    //将radiobutton添加到这三组中
    grounp1->addButton(ui->radioButton);
    grounp1->addButton(ui->radioButton_2);
    grounp1->addButton(ui->radioButton_3);

    grounp2->addButton(ui->radioButton_4);
    grounp2->addButton(ui->radioButton_5);
    grounp2->addButton(ui->radioButton_6);

    grounp3->addButton(ui->radioButton_7);
    grounp3->addButton(ui->radioButton_8);
    grounp3->addButton(ui->radioButton_9);

}

Widget::~Widget()
{
    delete ui;
}


//void Widget::on_radioButton_clicked()
//{
//    ui->label->setText("你转世成为：小猴子");
//}



//void Widget::on_radioButton_2_clicked()
//{
//    ui->label->setText("你转世成为：六耳猕猴");
//}



//void Widget::on_radioButton_3_clicked()
//{
//    ui->label->setText("你转世成为：猪妖");
//}
